package com.cg.cgms.mapper;

import com.cg.cgms.pojo.Shop;
import com.cg.cgms.pojo.UserLove;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;


@Mapper
public interface ShopMapper {
    @Select("select * from shop where ssid=#{ssid}")
    Shop findBYSsid(Integer ssid);

    @Select("select * from shop where name like concat('%',#{name},'%')")
    ArrayList<Shop> findByName( String name);
    //搜索功能，根据店铺种类查询店铺
    @Select("select * from shop where type=#{type}")
    ArrayList<Shop> findByType(String type);

    @Select("select * from userlvoe where openid=#{openid}")
    ArrayList<UserLove> userLvoe(String openid);
    @Select("select * from shop where type=#{type} and address=#{address}")
    ArrayList<Shop> findByTA(String address, String type);
}
